//
//  TopicTableViewCell.m
//  MyProject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "TopicTableViewCell.h"
#define widtht self.contentView.bounds.size.width
#define heigh self.contentView.bounds.size.height
@implementation TopicTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
    
    self.pic = [[UIImageView alloc] init];
    [self.contentView addSubview:self.pic];
    self.pic.layer.cornerRadius = 12;
    self.pic.clipsToBounds = YES;
    
    self.title = [[UILabel alloc] init];
    [self.pic addSubview:self.title];
    self.title.textColor = [UIColor whiteColor];
//   self.title.backgroundColor = [UIColor grayColor];
    
    self.view = [[UIImageView alloc] init];
    [self.pic addSubview:self.view];
        self.view.image = [UIImage imageNamed:@"lovebeijing.png"];
    self.view.alpha = 0.8;
    
    self.love = [[UIImageView alloc] init];
    [self.view addSubview:self.love];
    self.love.image = [UIImage imageNamed:@"aixin.png"];
    self.love.contentMode = UIViewContentModeScaleAspectFit;
    
    self.likes = [[UILabel alloc] init];
    [self.view addSubview:self.likes];
    self.likes.textColor = [UIColor whiteColor];
    self.likes.font = [UIFont systemFontOfSize:13];
    self.likes.textAlignment = NSTextAlignmentCenter;
    
    }
    return self;
}

- (void)layoutSubviews
{
    self.pic.frame = CGRectMake(5, 5, widtht - 10, heigh - 10);
    
    self.view.frame = CGRectMake(widtht / 3 * 2.4, heigh / 15 , 45, 45);
    
    self.title.frame = CGRectMake(10, heigh / 6 * 4.5, widtht - 20, heigh / 6);
    
    self.likes.frame = CGRectMake(0, self.view.bounds.size.height / 3 * 2 , self.view.bounds.size.width, self.view.bounds.size.height / 3);
    
    self.love.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height / 3 * 2);

}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
